<script src="__STATIC__/js/jquery-1.8.0.min.js"></script>
<form id="modifyDatum" method="post">
    <table>
        <tr style="height: 50px;">
            <td style="width: 150px;text-align: right;"><span style="color: red">※</span><label> 姓名：</label></td>
            <td><input type="text" class="form-control" placeholder="2-8位汉字(必填)" style="display: inline;width:211px" id="name" name="true_name"  value="{$userInfo.user_name}"/></td>
            <td><span id="errName" style="color: red"></span></td>
        </tr>
        <tr style="height: 50px;">
            <td style="text-align: right;"><label>姓别：</label></td>
            <td>
                <input type="radio" style="width: 15px;height:15px;" name="sex" id="man" {$userInfo.sex ? 'checked':''} value="1" /> 男
                <input type="radio" style="width: 15px;height:15px; margin-left:10px" name="sex" id="woman" {$userInfo.sex ? '':'checked'} value="0" /> 女
            </td>
        </tr>
        <tr style="height: 50px;">
            <td style="text-align: right;"><label>固定电话：</label></td>
            <td>
                <input type="text" class="form-control" placeholder="区号" style="display: inline;width: 80px;" name="area_code" id="areaCode"  value="{$userInfo.area_code}"/> -
                <input type="text" class="form-control" placeholder="固话" name="tel" id="tel"  value="{$userInfo.tel}" style="display: inline;width: 120px;"/>
            </td>
            <td>
                <span id="errAreaCode" style="color: red"></span>
            </td>
        </tr>
        <tr style="height: 50px;">
            <td style="text-align: right;"><label>通信地址：</label></td>
            <td>
                <input type="text" class="form-control" placeholder="具体地址(选填)" style="display: inline;width:211px" name="address" id="concreteAddress" value="{$userInfo.address}"/>
            </td>
        </tr>
        <tr style="height: 50px;">
            <td></td>
            <td><br>
                <input id="save" type="button" value="保 存"  style="width: 100px; line-height: 30px; background-color: #ed5736; color: #fff; font-size: 14px; border: 0; border-radius: 4px; margin-bottom: 24px;"/>
                <input type="button" value="返 回" style="width: 100px; line-height: 30px; background-color: #ed5736; color: #fff; font-size: 14px; border: 0; border-radius: 4px; margin-bottom: 24px;" onclick="javascript:history.back(-1)" />
            </td>
        </tr>
        <tr>
            <td></td>
            <td><br>
                <label id="msg"></label>
            </td>
        </tr>
    </table>
</form>
<script>
    $(function () {
        $('#save').click(function () {
            var name = $.trim($('#name').val());
            if(name == ''){
                alert('姓名必填!');
            }else{
                $.post('/api/api/savePer',$('#modifyDatum').serialize(),function (e) {
                    if(e.status == 1){
                        $('#msg').text('更新成功!').css('color','red');
                    }
                });
            }
        })
    })
</script>